package cn.tom.service.impl;

import cn.tom.entity.PublicInterest;
import cn.tom.mapper.PublicInterestMapper;
import cn.tom.service.PublicInterestService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("publicInterestService")
public class PublicInterestServiceImpl extends ServiceImpl<PublicInterestMapper, PublicInterest> implements PublicInterestService {
    @Autowired
     PublicInterestMapper publicInterestMapper;

    /**
     * 公益活动 根据时间查询最新的6条公益活动
     */
    public List<PublicInterest> findByDay(){
        List<PublicInterest> byDay = publicInterestMapper.findByDay();
        return byDay;
    }
    /**
     * 公益活动
     */
    public PublicInterest findById(Long id){
        PublicInterest byId = publicInterestMapper.findById(id);
        return byId;
    }

}